package com.yw.task.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;
import java.time.LocalDateTime;
import java.util.Map;

@Entity
@Data
@Table(name = "task")
public class Task {

    @jakarta.persistence.Id
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Schema(description = "唯一标识符，主键，自增")
    private Integer id;


    @Schema(description = "任务分类")
    private Integer taskCategory;


    @Schema(description = "任务名称")
    private String taskName;


    @Schema(description = "任务描述")
    private String taskDescription;


    @Schema(description = "发布状态")
    private Integer publishStatus;


    @Schema(description = "创建时间")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private LocalDateTime createTime;


    @Schema(description = "更新时间")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private LocalDateTime updateTime;


    @Schema(description = "节点信息（JSON 格式）")
    private String node;

    @Schema(description = "定时任务信息（JSON 格式）")
    private String scheduledTask;

    @Schema(description = "API 信息（JSON 格式）")
    private String api;

}
